#ifndef __ABSTRACT_FACTORY_HPP__
#define __ABSTRACT_FACTORY_HPP__

#include "abstract_producta.hpp"
#include "abstract_productb.hpp"

class AbstractFactory {
public:
	virtual ~AbstractFactory();
	virtual AbstractProductA *createProductA() = 0;
	virtual AbstractProductB *createProductB() = 0;
protected:
	AbstractFactory() : a1(NULL),a2(NULL),b1(NULL),b2(NULL){ cout<<__func__<<endl; }
	AbstractProductA *a1;
	AbstractProductA *a2;
	AbstractProductB *b1;
	AbstractProductB *b2;

};

inline AbstractFactory::~AbstractFactory()
{
	cout<<__func__<<endl;
	if (a1) {
		delete a1;
	}
	if (a2) {
		delete a2;
	}
	if (b1) {
		delete b1;
	}
	if (b2) {
		delete b2;
	}
}
#endif /* end of include guard */
